import type { LoginReqType, LoginRespType, RegisterReqType } from './type';

import { alovaIns } from './request';

import urls from './urls';
const postRequest = <T>(url: string, params?: any) => alovaIns.Post<T, unknown>(url, params);
// const getRequest = <T>(url: string, params?: Record<string, any>) =>
//   alovaIns.Get<T>(url, { params });
export default {
  /**
   * 用户相关
   */
  /** 用户登录 */
  userLogin: (data: LoginReqType) => postRequest<LoginRespType>(urls.login, data),
  /** 用户注册 */
  userRegister: (data: RegisterReqType) => postRequest<void>(urls.register, data)
};
